package com.sooncode.project.focusservice.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sooncode.project.core.annotations.Lookup;
import com.sooncode.project.core.annotations.LookupModel;
import com.sooncode.project.core.generic.BasicAddEvent;
import com.sooncode.project.focusservice._.base.BaseDomainModel;
import lombok.Data;

import java.util.Date;

@Data
@LookupModel
public class DeviceLogin extends BaseDomainModel<DeviceLogin> {
    private String orgId;
    @Lookup(fromModel = Organization.class,localField = "orgId",fromField = "name")
    private String orgName;
    private String deviceMac;
    private String deviceVer;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date loginDate;
    public void add(){
        causes(BasicAddEvent.class);
    }
}
